package com.blog.bzl.myblog.dao;

import com.blog.bzl.myblog.model.baseobj.BaseModel;
import com.blog.bzl.myblog.model.baseobj.BaseQuery;

import java.util.List;

/**
 * @Author: long
 * @Description:
 * @Date: Create in 2017.09.09 16:09
 * @Modified By:
 * @ClassName: com.blog.bzl.myblog.dao.BaseDao
 */
public  interface BaseDao<M extends BaseModel, Q extends BaseQuery> {

    /**
     * 根据条件获取列表
     * @param query
     * @return
     */
    List<M> selectByCondition(Q query);

    /**
     * 根据条件获取列表数量
     * @param query
     * @return
     */
    Long selectByConditionForCount(Q query);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    int insert(BaseModel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    int insertSelective(BaseModel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    M selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(M record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table myblog_BaseModel
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(M record);
}
